package com.fate.system.service;

import com.fate.system.dto.wx.AccessTokenDTO;
import com.fate.system.vo.wx.WxOpenIdVO;
import jakarta.servlet.http.HttpServletResponse;

public interface IWxService {
  /**
   * 获取access_token
   *
   * @return AccessTokenDTO
   */
  AccessTokenDTO getAccessToken() throws Exception;

  /**
   * 获取小程序码的Buffer
   *
   * @param path 跳转路径
   * @param envVersion 环境版本 正式版为 release，体验版为 trial，开发版为 develop
   * @param width 二维码宽度
   * @param isHyaline 是否需要透明底色
   * @param response HttpServletResponse
   */
  void getQrCode(
      String path,
      String envVersion,
      Integer width,
      Boolean isHyaline,
      HttpServletResponse response)
      throws Exception;

  /**
   * 获取用户openId
   *
   * @param code js_code
   * @return
   * @throws Exception
   */
  WxOpenIdVO getUserOpenId(String code) throws Exception;
}
